/*
 * Created by LiuYou on 2020/10/22.
 *
 */

#ifndef QUESTIONS_HPP
#define QUESTIONS_HPP


#include <string>
#include <ostream>


namespace ly {


    class Questions {
    public:
        friend std::ostream& operator<<(std::ostream& os, const Questions& questions);

        int getDifficulty() const {
            return difficulty;
        }

        void setDifficulty(int difficulty) {
            Questions::difficulty = difficulty;
        }

        const std::string& getQuestionType() const {
            return questionType;
        }

        void setQuestionType(const std::string& questionType) {
            Questions::questionType = questionType;
        }

        const std::string& getQuestion() const {
            return question;
        }

        void setQuestion(const std::string& question) {
            Questions::question = question;
        }

        Questions() = default;

        Questions(int difficulty, const std::string& questionType, const std::string& question) : difficulty(
                difficulty), questionType(questionType), question(question) {}

    protected:
        int difficulty{0};
        std::string questionType;
        std::string question;

    };

    std::ostream& operator<<(std::ostream& os, const Questions& questions) {
        os << "难度: " << questions.difficulty << " 题目类型: " << questions.questionType << " "
           << questions.question;
        return os;
    }


}


#endif // QUESTIONS_HPP
